package eureka.flink.chap10;

import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @author com.eureka.wh
 * @since 2019/6/22 23:47
 */
public class MapTest {

    public static void main(String[] args) throws Exception {

       final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        DataStream<Long> input = env.generateSequence(0, 10);

        // 注意，并不是所有情况都能使用lambada表达式，很多时候需要使用RichXXXFunction{。。。}
        input.map((x)->(x+10)).print();

//        input.map(x->x+1).print();

//        input.map((Long x) -> {
//           return x + 1;
//        }).print();

        env.execute("MapTest");

    }
}
